#ifndef LIQUID_COOLER_DATA_H
#define LIQUID_COOLER_DATA_H

#include <QtCore>

//液冷机(Lc=LiquidCooler)
class CLcData
{
public:
    bool IsCommNormal();
    bool IsCommFault();

    bool IsRunning();
    bool IsStopped();

    bool IsFault();
    bool IsNoFault();

    bool IsAlarm();
    bool IsNoAlarm();

    bool IsOpening();
    bool IsClosed();

    //获取***的显示文本
    QString GetCommStateText();

    void InitToInvalid();
    void InitToZero();
    void InitToValue(quint16 uvalue, float fvalue);

public:
    quint16 m_uCommState;           //2401 通讯状态 0--正常,1-故障
    quint16 m_uRev[99];
    float m_fRev[100];

    //转发的100个UINT16数据
    quint16 m_uRunState;            //2402 运行状态 0运行,1停止
    quint16 m_uFaultState;          //2403 故障状态 0正常,1故障
    quint16 m_uAlarmState;          //2404 告警状态 0正常,1告警
    quint16 m_uSwitchState;         //2405 开关机状态 0已开机,1已关机
    quint16 m_uWorkState;           //2406 工作状态 0待机,1制冷,2制热,3循环,4自动,5除湿

    quint16 m_uFaultCode;           //2407 液冷机故障码
    quint16 m_uEngineSpeed;         //2408 液冷压缩机转速
    quint16 m_uPumpSpeed;           //2409 液冷水泵转速
    quint16 m_uDebugState;          //2410 调试开关状态 0--已关闭，1--已开启
    quint16 m_uAlarmCode1;          //2411 告警码1

    quint16 m_uAlarmCode2;          //2412 告警码2
    quint16 m_uAlarmCode3;          //2413 告警码3
    quint16 m_uAlarmCode4;          //2414 告警码4
    quint16 m_uAlarmCode5;          //2415 告警码5
    quint16 m_uAlarmCode6;          //2416 告警码6

    quint16 m_uFaultCode1;          //2417 故障码1
    quint16 m_uFaultCode2;          //2418 故障码2
    quint16 m_uFaultCode3;          //2419 故障码3
    quint16 m_uFaultCode4;          //2420 故障码4
    quint16 m_uFaultCode5;          //2421 故障码5

    quint16 m_uFaultCode6;          //2422 故障码6

    quint16 m_uPumpState1;          //2423 液冷1#水泵运行状态:0停止,1运行
    quint16 m_uPumpState2;          //2424 液冷2#水泵运行状态:0停止,1运行
    quint16 m_uPumpState3;          //2425 液冷3#水泵运行状态:0停止,1运行
    quint16 m_uPumpState4;          //2426 液冷4#水泵运行状态:0停止,1运行
    quint16 m_uPumpState5;          //2427 液冷5#水泵运行状态:0停止,1运行

    quint16 m_uCoolerState1;        //2428 #1压缩机运行状态:0停止,1运行
    quint16 m_uCoolerState2;        //2429 #2压缩机运行状态:0停止,1运行
    quint16 m_uCoolerState3;        //2430 #3压缩机运行状态:0停止,1运行
    quint16 m_uCoolerState4;        //2431 #4压缩机运行状态:0停止,1运行
    quint16 m_uCoolerState5;        //2432 #5压缩机运行状态:0停止,1运行

    quint16 m_uSupplyWaterState;    //2433 补液状态:0正常,1运行
    quint16 m_uRemoteState;         //2434 远程状态:0本地,1远程
    quint16 m_uAlarmLevel;          //2435 告警等级:0无,1一级告警,2二级告警
    quint16 m_uMachineEnable;       //2436 机组开机使能:0监控关机,1监控开机
    quint16 m_uTempControlMode;      //2437 水温目标控制模式:0出水温度;1回水温度;2环境温度

    quint16 m_uData[64];            //2438~2600 转发的UINT16数据:预留,数组数量=100-上面的转发数

    //转发的100个FLOAT数据
    float m_fOutWaterTemp;          //2601 供(出)水温度℃
    float m_fInWaterTemp;           //2603 回(进)水温度℃
    float m_fOutWaterPres;          //2605 供(出)水压力bar pressure
    float m_fInWaterPres;           //2607 回(进)水压力bar
    float m_fEnvTemp;               //2609 环境温度℃

    float m_fCoolStartTemp;         //2611 制冷开启温度℃
    float m_fCoolStopTemp;          //2613 制冷停止温度℃
    float m_fCoolDiffTemp;          //2615 制冷回差温度℃
    float m_fHeatStartTemp;         //2617 制热开启温度℃
    float m_fHeatStopTemp;          //2619 制热停止温度℃

    float m_fHeatDiffTemp;          //2621 制热回差温度℃
    float m_fDryStartHumi;          //2623 除湿开启湿度%
    float m_fDryStopHumi;           //2625 除湿停止湿度%
    float m_fDryDiffHumi;           //2627 除湿回差湿度%
    float m_fDebugSglMaxTemp;       //2629 调试下的单体最大温度℃

    float m_fDebugSglMinTemp;       //2631 调试下的单体最小温度℃
    float m_fDebugSglAvgTemp;       //2633 调试下的单体平均温度℃
    float m_fDebugSglMaxTempDiff;   //2635 调试下的单体最大温差℃
    float m_fVentilateTemp;         //2637 排气温度
    float m_fAcCur;                 //2639 交流电流

    float m_fAcVol;                 //2641 交流电压
    float m_fDcCur;                 //2643 直流电流
    float m_fDcVol;                 //2645 直流电压
    float m_fCoolFlow;              //2647 制冷流量    
    float m_fOutSteamTemp;          //2649 蒸出当前温度

    float m_fInSteamTemp;           //2651 蒸进当前温度

    float m_fData[74];              //2653~2999 转发的FLOAT数据:预留,数组数量=100-上面的转发数

    // 2401     2600	200	UINT16	200	读液冷的UNIT16数据0x03/0x04  无 液冷数据
    // 2601     3000	400	FLOAT	200	读液冷的FLOAT数据	0x03/0x04   无
    // 20801	21000	200	UINT16	200	写液冷的数据      0x03/0x04	0x06

    //**对方还需要读取;**拷贝，供其他程序使用和置位
    quint16 m_uSetWorkState;            // 20801 下设的工作状态 UINT16 0待机 1制冷 2制热 3循环 4自动
    quint16 m_uSetWorkStateCopy;
    //"实际值=寄存器值*0.01-100 寄存器值=(实际值+100)*100 实际值范围:-100~100"
    float m_fSetCoolStartTemp;          // 20802 下设的制冷开启温度 UINT16 0.01 -100 ℃
    float m_fSetCoolStartTempCopy;
    float m_fSetCoolStopTemp;           // 20803 下设的制冷停止温度 UINT16 0.01 -100 ℃
    float m_fSetCoolStopTempCopy;
    float m_fSetCoolDiffTemp;           // 20804 下设的制冷回差温度 UINT16 0.01 -100 ℃
    float m_fSetCoolDiffTempCopy;
    float m_fSetHeatStartTemp;          // 20805 下设的制热开启温度 UINT16 0.01 -100 ℃
    float m_fSetHeatStartTempCopy;
    float m_fSetHeatStopTemp;           // 20806 下设的制热停止温度 UINT16 0.01 -100 ℃
    float m_fSetHeatStopTempCopy;
    float m_fSetHeatDiffTemp;           // 20807 下设的制热回差温度 UINT16 0.01 -100 ℃
    float m_fSetHeatDiffTempCopy;
    float m_fSetDryStartHumi;           // 20808 下设的除湿开启湿度 UINT16 0.01 -100 %
    float m_fSetDryStartHumiCopy;
    float m_fSetDryStopHumi;            // 20809 下设的除湿停止湿度 UINT16 0.01 -100 %
    float m_fSetDryStopHumiCopy;
    float m_fSetDryDiffHumi;            // 20810 下设的除湿回差湿度 UINT16 0.01 -100 %
    float m_fSetDryDiffHumiCopy;
    float m_fSetTargetTemp;             //20811 设定目标温度
    float m_fSetTargetTempCopy;
    float m_fSetTargetCheckTemp;        //20812 设定目标温度反校
    float m_fSetTargetCheckTempCopy;
    quint16 m_uSetSwitch;               //20813 下设开关机:0关机,1开机
    quint16 m_uSetSwitchCopy;
    quint16 m_uSetControlMode;          //20814 下设控制模式:0BMS控制,1自动控制,2强制控制
    quint16 m_uSetControlModeCopy;
    quint16 m_uSetMachineEnable;        //20815 机组开机使能:0监控关机,1监控开机
    quint16 m_uSetMachineEnableCopy;
    quint16 m_uSetTempControlMode;      //20816 水温目标控制模式:0出水温度;1回水温度;2环境温度
    quint16 m_uSetTempControlModeCopy;
    float   m_fSetMonitorTempMax;       //20817 监控下发最大温度，单位为℃
    float   m_fSetMonitorTempMaxCopy;
    float   m_fSetMonitorTempMin;       //20818 监控下发最小温度，单位为℃
    float   m_fSetMonitorTempMinCopy;
    float   m_fSetMonitorMaxAvg;        //20819 监控下发平均温度，单位为℃
    float   m_fSetMonitorMaxAvgCopy;
    //20815~20200 设置的数据:预留,数组数量=30-上面的设置数
    quint16 m_uSetData[11];
    quint16 m_uSetDataCopy[11];
};

#endif //LIQUID_COOLER_DATA_H
